<template>
    <Root :Config="Config" ref="RootView" />
    <a-button type="Success" @click="GetValue">GetValue</a-button>
</template>
<script setup>
import Root from './index.vue'
import { ref, provide, nextTick } from 'vue'

import Config from './config/000001'
import Dict from './config/Dict'


const GetDict = async function (key) {
    return Dict[key]
}

const GetModel = async function (key) {
    return ModelMapping[key]
}

provide('GetDict', GetDict);
provide('GetModel', GetModel);

const RootView = ref();

const GetValue = () => {
    RootView.value.GetValue((Err, Val) => {
        console.log(Err, Val);
    });
}


nextTick(() => {
    RootView.value.ReadonlyAll(true);

    setTimeout(() => {
        var value = {
            "id": -1,
            "name": "12",
            "state": 0,
            "longitude": 123.123,
            "latitude": 23.123,
            "Tree": [1],
            "TreeChild": null,
            "TreeChildChild": null,
            "isbyte": 7,
            "int": 0,
            "Number": 0,
            "RadioState": 0,
            "CheckBox": false,
            "CheckBoxGroup": 3,
            "Star": 2234,
            "End": 3434,
            "Textarea": "默认名称2222",
            "Cascader": [1, 11],
            "TimePicker": "2023-03-11",
            "Swith": false
        }
        RootView.value.SetValue(value);
        RootView.value.ReadonlyAll(false);

    }, 1000)

})




</script>
<style lang="less" scoped></style>